package com.zzr.zzrbackend.controller;

import com.zzr.zzrbackend.pojo.dto.CommonResult;
import com.zzr.zzrbackend.pojo.dto.result.AESResult;
import com.zzr.zzrbackend.service.AESService;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;



@RestController
public class AESController {

    @Resource
    private AESService aesService;

    /**
     * 获取详细解惑信息
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/api/privacy/disabuse", method = RequestMethod.GET)
    public CommonResult<AESResult> getDisabuse(HttpServletRequest request, Integer disabuseId) throws Exception {
        return aesService.getDisabuseDetail(request, disabuseId);
    }

    /**
     * 获取列表信息
     *
     * @param time
     * @return
     */
    @GetMapping("/api/privacy/track-record/list")
    public CommonResult<AESResult> list(HttpServletRequest request, @RequestParam(value = "time") Integer time) {
        return aesService.list(request, time);
    }

    /**
     * 获取列表信息
     *
     * @param request
     * @return
     */
    @GetMapping("/api/privacy/my-profile")
    public CommonResult<AESResult> getMyProfile(HttpServletRequest request) {
        return aesService.getMyProfile(request);
    }

    /**
     * 获取紧急联系人
     *
     * @param request
     * @return
     */
    @GetMapping("/api/privacy/emerge-person")
    public CommonResult<AESResult> getEmergePerson(HttpServletRequest request) {
        return aesService.getEmergePerson(request);
    }
}
